package com.example.springbootmyelasticjob.dao;

import com.example.springbootmyelasticjob.model.Student;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@Mapper
public interface TestDao {

    @Select("SELECT * FROM student where state is null LIMIT #{page}, 3")
    List<Student> findAll(@Param("page") Long page);

    @Update("UPDATE student SET state=#{state} WHERE id=#{id}")
    void update(@Param("state") Long state, @Param("id") String id);
}
